<?php
namespace app\php\controller;  // 必须继承于app 第二个是具体的应用名  例 t5/note/tp
use think\Controller;
//use think\Request;
use think\config;
use think\Db;

class Indexword extends Controller

{

	/***
	 * 验证引入了word
	 */
	public function index(){
		echo 'note/php/indexword';
	Vendor('phpoffice.phpWord.src.PhpWord.PhpWord');
	// Vendor('phpoffice.phpWord.src.PhpWord.IOFactory');
$mod = new \PhpOffice\PhpWord\PhpWord();   // 注意反斜杠
$mod->test();
}

/**
 * 
 */
public function index2(){
	Vendor('phpoffice.phpWord.src.PhpWord.PhpWord');
	 Vendor('phpoffice.phpWord.src.PhpWord.IOFactory');
$mod = new \PhpOffice\PhpWord\PhpWord();   // 注意反斜杠
//读取文件
$file = "../note/php/controller/Phpword.doc";
 $word = \PhpOffice\PhpWord\IOFactory::load($file);
dump($file);


}

/**
 * 
 */
public function index3(){
	$word = new COM("word.application") or die("Can't start Word!");  
	
	$word->Visible = 0;
	echo "<br/>Loading Word, v. {$word->Version}";
	
	$word->Documents->open(dirname(__FILE__)."/Phpword.doc");
	$test= $word->ActiveDocument->content->Text;
	echo $test;



}

}